@echo off
::以管理员身份运行
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
bcdedit >nul
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
:UACPrompt
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
exit /B
:UACAdmin
cd /d "%~dp0"

::获取时间
for /f "delims=/ tokens=1-3" %%a in ("%date:~0,10%") do (call set "newDate=%%a%%b%%c")
for /f "tokens=* delims= " %%a in ("%time:~0,5%") do (for /f "tokens=1,2 delims=:" %%i in ("%%a") do (call set "newTime=%%i%%j"))
set "dateName=%newDate%-%newTime%"



copy "C:\Windows\System32\drivers\etc\hosts" "C:\Windows\System32\drivers\etc\hosts_bk_%dateName%"

exit